package com.battery.system.domain;

import com.battery.common.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

/**
 * 采购订单状态对象 ws_purchase_status
 *
 * @author battery
 * @date 2021-01-22
 */
@Table(name = "ws_purchase_status")
public class PurchaseStatus {
    private static final long serialVersionUID = 1L;

    /**
     *
     */
    @Id
    @KeySql(useGeneratedKeys = true)
    private String purchaseId;

    /**
     * 订单状态
     */
    @Excel(name = "订单状态")
    private Long orderStatus;

    /**
     * 订单创建时间;对应[10:待付款]状态
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "订单创建时间;对应[10:待付款]状态", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdTime;

    /**
     * 支付成功时间;对应[20:已付款，待发货]状态
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "支付成功时间;对应[20:已付款，待发货]状态", width = 30, dateFormat = "yyyy-MM-dd")
    private Date payTime;

    /**
     * 发货时间;对应[30：已发货，待收货]状态
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "发货时间;对应[30：已发货，待收货]状态", width = 30, dateFormat = "yyyy-MM-dd")
    private Date deliverTime;

    /**
     * 交易成功时间;对应[40：交易成功]状态
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "交易成功时间;对应[40：交易成功]状态", width = 30, dateFormat = "yyyy-MM-dd")
    private Date successTime;

    /**
     * 交易关闭时间;对应[50：交易关闭]状态
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "交易关闭时间;对应[50：交易关闭]状态", width = 30, dateFormat = "yyyy-MM-dd")
    private Date closeTime;

    private String outOrder;

    private String refundOr;

    private String transtionId;

    private Date refundTime;

    public String getOutOrder() {
        return outOrder;
    }

    public void setOutOrder(String outOrder) {
        this.outOrder = outOrder;
    }

    public String getRefundOr() {
        return refundOr;
    }

    public void setRefundOr(String refundOr) {
        this.refundOr = refundOr;
    }

    public String getTranstionId() {
        return transtionId;
    }

    public void setTranstionId(String transtionId) {
        this.transtionId = transtionId;
    }

    public Date getRefundTime() {
        return refundTime;
    }

    public void setRefundTime(Date refundTime) {
        this.refundTime = refundTime;
    }

    public void setPurchaseId(String purchaseId) {
        this.purchaseId = purchaseId;
    }

    public String getPurchaseId() {
        return purchaseId;
    }

    public void setOrderStatus(Long orderStatus) {
        this.orderStatus = orderStatus;
    }

    public Long getOrderStatus() {
        return orderStatus;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }

    public Date getPayTime() {
        return payTime;
    }

    public void setDeliverTime(Date deliverTime) {
        this.deliverTime = deliverTime;
    }

    public Date getDeliverTime() {
        return deliverTime;
    }

    public void setSuccessTime(Date successTime) {
        this.successTime = successTime;
    }

    public Date getSuccessTime() {
        return successTime;
    }

    public void setCloseTime(Date closeTime) {
        this.closeTime = closeTime;
    }

    public Date getCloseTime() {
        return closeTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("purchaseId", getPurchaseId())
                .append("orderStatus", getOrderStatus())
                .append("createdTime", getCreatedTime())
                .append("payTime", getPayTime())
                .append("deliverTime", getDeliverTime())
                .append("successTime", getSuccessTime())
                .append("closeTime", getCloseTime())
                .toString();
    }
}
